package de.fanuffel.generic.functions;

import de.fanuffel.generic.structures.Pair;

/*
 * Created on 12.05.2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

public class CurriedFun<Dom1, Dom2, Cod> implements Function<Dom2, Cod> {
  private final Function<Pair<Dom1, Dom2>, Cod> f;
  private final Dom1 d;

  public CurriedFun(Function<Pair<Dom1, Dom2>, Cod> f, Dom1 d) {
    this.f = f;
    this.d = d;
  }

  public Cod eval(Dom2 argument) {
    return f.eval(new Pair<Dom1, Dom2>(d, argument));
  }
}